package com.scc.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.scc.entity.Answers;
import com.scc.mapper.AnswersMapper;
import com.scc.mapper.QuestionsMapper;
import com.scc.service.IAnswersService;

@Service("answersService")
public class AnswerServiceImpl implements IAnswersService{

	@Resource
	private AnswersMapper answerMapper;
	@Resource
	private QuestionsMapper questionMapper;
	@Override
	public List<Answers> selByQid(long qid) {
		return answerMapper.selByQid(qid);
	}

	@Override
	public void answer(Answers ans) {
		answerMapper.insAnswer(ans);
		questionMapper.updQuestion(ans.getQid());	
	}

}
